# ALTERNATIVE EXECUTION --------------------------------------------------------
#   The main.R script processes all three datasets in a loop. 
#   To run each dataset manually, use the following script.

rm(list = ls())
setwd(getwd())

dir.create(file.path(getwd(), "plots"), showWarnings = FALSE)
dir.create(file.path(getwd(), "tables"), showWarnings = FALSE)

source('code/libraries.R')
source('code/functions.R')

datasets <- list(
  "1" = read.csv("data/clean_data_1.csv", stringsAsFactors = TRUE),
  "2" = read.csv("data/clean_data_2.csv", stringsAsFactors = TRUE),
  "3" = read.csv("data/clean_data_3.csv", stringsAsFactors = TRUE)
)

experiment <- "INPUT CHOICE HERE" # Choose 1, 2, or 3
df <- datasets[[experiment]] 

source("code/variables.R")
source("code/mapping.R")
source("code/models.R")
source("code/plots.R")
source("code/tables.R")

rm(list = ls())
